import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:smart_lam/style/style.dart';

class CustomAppbar extends StatelessWidget {

  final VoidCallback leftClick;

  CustomAppbar({required this.leftClick});

  @override
  Widget build(BuildContext ctx) {
    return Container(
      height: ScreenUtil().setHeight(Get.height*0.1),
      padding: EdgeInsets.only(top: ScreenUtil().setWidth(40)),
      child: Flex(
        direction: Axis.horizontal,
        children: [
          IconButton(
              icon: Icon(
                Icons.keyboard_backspace,
                color: Colors.white,
              ),
              onPressed: leftClick),
          Expanded(
            flex: 1,
            child: Text(
              '氛围灯',
              textAlign: TextAlign.center,
              style: CustomStyle(ctx).customTextStyle(
                  fontSize: 18, color: Colors.white),
            ),
          ),
          IconButton(
              icon: Icon(
                Icons.more_horiz_outlined,
                color: Colors.white,
              ),
              onPressed: leftClick
          )
        ],
      ));
  }
}